<script type="text/javascript">
  function checkForm(){

    if(form1.sku.value == ''){
  
      alert('SKU不能为空！');
      form1.sku.focus();
      return false;
    }
    
    if(form1.sku_name.value == ''){
        alert('SKU名称不能为空！');
        form1.sku_name.focus();
        return false;
    }

    var count = form1.sku_quality.value;
    var count = Number(count);
    if(isNaN(count)){
  
      alert('数量格式非法！');
      form1.sku_quality.focus();
      return false;
    }
    if(count < 1){
      alert('数量不能为0！');
      form1.sku_quality.focus();
      return false;
    }
    var quality = form1.sku_quality.value;
    if(/^\d+$/.test(quality)){
      
    }else{
       alert('数量不能有小数！');
      form1.sku_quality.focus();
      return false;
    }
    if(form1.remarks.value == ''){
        alert('不合格原因不能为空！');
        form1.remarks.focus();
        return false;
    }
  }
</script>
<body id="pageContent" class="well">
<div class="container-fluid">
  <form class="form-horizontal"  action="<?php echo url::base(true)?>quality/updatebadproduct" method="post" name="form1" onsubmit="return checkForm();">
    <div class="control-group">
    <label class="control-label" for="input01" >SKU:</label>
        <div class="controls">
          <input type="text" class="input-xlarge" readOnly=true  name="sku" id="sku" value="<?php echo $info['0']['sku']; ?>" />
        </div>
    </div>
    <div class="control-group">
    <label class="control-label" for="input01">中文名称:</label>
        <div class="controls">
          <input type="text" class="input-xlarge" readOnly=true name="sku_name" id="sku_name" value="<?php echo $info['0']['sku_name']; ?>" />
        </div>
    </div>
    <div class="control-group">
    <label class="control-label" for="input01">数量:</label>
        <div class="controls">
          <input type="text" class="input-xlarge" <?php if($purchaseid>0){?> readOnly=true <?php } ?> name="sku_quality" id="sku_quality" value="<?php echo $info['0']['quantity']; ?>" />
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">质检不合格原因:</label>
        <div class="controls">
          <div class="textarea">
                <textarea type="" class="" style="margin: 0px; width: 272px; height: 117px;" name="remarks" id="remarks" ><?php echo $info['0']['quality_remark']; ?></textarea>
          </div>
        </div>
        <input type="hidden" class="input-xlarge"  name="id" id="id" value="<?php echo $id; ?>" />
    </div>
    <div class="control-group">
        <label class="control-label"></label>
        <!-- Button -->
        <div class="controls">
          <button class="btn btn-info" id="addsubnit_ids">提交</button> &nbsp;&nbsp;
        </div>
    </div>
  </form>
</div>
 </body>
 
